import axios from '@/utils/axios';

// 分页获取导航菜单
export const getNavigationList = (params) => {
    return axios.request({
        url: '/site/menu/page',
        method: 'get',
        params
    });
};

// 获取菜单导航
export const getNavigationLink = (siteId) => {
    return axios.request({
        url: `/site/menu/${siteId}/link`,
        method: 'get'
    });
};

// 删除导航菜单
export const deleteNavigation = (siteId, menuId) => {
    return axios.request({
        url: `site/menu/${siteId}/${menuId}`,
        method: 'delete'
    });
};

// 新增导航菜单
export const addNavigation = (data) => {
    return axios.request({
        url: '/site/menu/',
        data,
        method: 'post'
    });
};

// 获取菜单导航详情
export const getNavigation = (siteId, menuId) => {
    return axios.request({
        url: `site/menu/${siteId}/${menuId}`,
        method: 'get'
    });
};

// 更新导航
export const updateNavigation = (id, data) => {
    return axios.request({
        url: `site/menu/${id}`,
        data,
        method: 'put'
    });
};
